package com.panopset;

import static com.panopset.Util.dump;

import java.awt.GridLayout;

import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import com.panopset.centralen.SysInfo;
import com.panopset.gui.TPanel;

/**
 *
 * System information panel.
 *
 * @author Karl Dinwiddie
 *
 */
public final class SysInfoPanel {

    /**
     * Sleep cycle is one second, or 1000 milliseconds.
     */
    public static final int SLEEP_CYCLE = 1000;

    /**
     * Swing panel.
     */
    private TPanel gui;

    /**
     * @return Swing system information panel.
     */
    public TPanel getGui() {
        if (gui == null) {
            gui = new TPanel(new GridLayout(1, 1));
            JTextArea ta = new JTextArea(dump(SysInfo.getMap()));
            ta.setEditable(false);
            gui.add(new JScrollPane(ta));
        }
        return gui;
    }

}
